//
//  XCVisitorView.swift
//  小陈微博Swift用纯代码创建
//
//  Created by 小陈 on 16/2/26.
//  Copyright © 2016年 小陈. All rights reserved.
//

import UIKit

///  访客登录视图协议
protocol VisitorLoginViewDelegate:NSObjectProtocol{
    ///  选中注册按钮
    func didSelectResgisterButton()
    /// 选中登录按钮
    func didSelectedLonginButton()
}

class XCVisitorView: UIView {
    weak var delegate:VisitorLoginViewDelegate?
    
    /// 首页和消息、发现、我 的图片
    @IBOutlet weak var IconView: UIImageView!
    /// 圆形的图片
    @IBOutlet weak var SmallIcon: UIImageView!
    @IBOutlet weak var MessageLable: UILabel!
    
    
    func setUpInfo(imageName:String,message:String,isHome:Bool = false ){
        IconView.hidden = !isHome
        if isHome {
            IconView.image = UIImage(named: imageName)
            SmallIcon.image = UIImage(named: "visitordiscover_feed_image_smallicon")
        }else{
            SmallIcon.image = UIImage(named: imageName)
        }
        MessageLable.text = message
    }
    
    
    
    
    
    
    
    
    
    
    
    
   // 注销按钮
    @IBAction func Registe() {
        delegate?.didSelectResgisterButton()
    }
  // 登录按钮
    @IBAction func Login() {
        delegate?.didSelectedLonginButton()
    }
}
